const fs = require('fs');

function readFile(filePath) {
    return new Promise((resolve, reject) => {
        fs.readFile(filePath, 'utf8', (err, data) => {
            if (err) {
                reject(err);
            } else {
                resolve(data);
            }
        });
    });
}

/* 面试题：记住 在javascript里面如果遇到异步不会等待，跳过，先去执行同步 */
;
async function go() {
    let dataA = await 123;

    return dataA; // 123
}



/* 异步函数可以嵌套 */
(async () => {
    let rs = await go();
    console.log(rs);

})();